﻿#include "CmdSavePostMarkerAddSettingData.h"
#include <QFile>
#include <QDebug>
#include "BaseModule/IBaseSignal.h"
#include "PostCommandPy.h"

namespace PostCommand
{
    CmdSavePostMarkerAddSettingData::CmdSavePostMarkerAddSettingData()
        : CommandBase()
    {
        this->initCmdName();
    }
    CmdSavePostMarkerAddSettingData::~CmdSavePostMarkerAddSettingData()
    {
    }

    bool CmdSavePostMarkerAddSettingData::execute()
    {
        emit IBaseSignalInstance->signal_savePostMarkerAddSettingData(m_windowUniversalID,
                                                                      m_infomationGraph3DBasicalId,
                                                                      m_type,
                                                                      m_fieldIndex,
                                                                      m_fieldName,
                                                                      m_pickedId,
                                                                      m_pickedValue);
        return true;
    }

    void CmdSavePostMarkerAddSettingData::undo()
    {
    }

    void CmdSavePostMarkerAddSettingData::redo()
    {
        // execute();
    }

    void CmdSavePostMarkerAddSettingData::savePostMarkerAddSettingData(int windowUniversalID, int infomationGraph3DBasicalId, int type,
                                                                                     int fieldIndex, QString fieldName, int pickedId, QString pickedValue)
    {
        m_windowUniversalID = windowUniversalID;
        m_infomationGraph3DBasicalId = infomationGraph3DBasicalId;
        m_type = type;
        m_fieldIndex = fieldIndex;
        m_fieldName = fieldName;
        m_pickedId = pickedId;
        m_pickedValue = pickedValue;
    }

} // namespace PostCommand
